import Vue from 'vue'
import Vuex from 'vuex'
import problems from './modules/problem';
Vue.use(Vuex)

export default new Vuex.Store({
    namespace: true,
    state: {
        // 解决方案不再提示标识符
        close: false,
        // 题库的题目答对数量
        count: 0,
        // 题库题目总数
        questioncounts: 0,
    },
    getter(state) {
        return state.count
    },
    mutations: {
        notTips(state, { flag }) {
            state.close = flag
        },
        addCount(state) {
            state.count += 1
        },
        resetCount(state) {
            state.count = 0
        },
        setQuestionCounts(state, { questioncount }) {
            state.questioncounts = questioncount
        }
    },
    actions: {},
    modules: { problems }
})